package clientApp;

import java.util.ArrayList;
import java.util.HashMap;

import clientApp.utils.RPG_Workstation_Container;

import game.referenceValues.Skill;
import game.referenceValues.UnitClass;

import game.units.Character;

/**
 * 
 * @author Gabriel
 */
@SuppressWarnings("serial")
public class CharacterBuilder4 extends javax.swing.JPanel {

	RPG_Workstation_Container container;
	Character character;
	UnitClass lvlClass;
	HashMap<String, Skill> skillMap;
	int tempValue = 0;
	int skillPoints;
	boolean isNewChar = false;

	String[] Skills = { "Appraise", "Balance", "Bluff", "Climb",
			"Concentration", "Craft", "Diplomacy", "Disable Device",
			"Disguise", "Escape Artist", "Gather Information", "Handle Animal",
			"Heal", "Hide", "Intimidate", "Jump", "Knowledge", "Listen",
			"Move Silently", "Open Lock", "Perform", "Ride", "Search",
			"Sense Motive", "Sleight of Hand", "Spellcraft", "Spot",
			"Survival", "Swim", "Tumble", "Use Magic Device" };

	/** Creates new form CharacterBuilder4 */
	public CharacterBuilder4(RPG_Workstation_Container rpg_Workstation_Container,
			Character character, UnitClass charClass, boolean isNewChar) {
		this.container = rpg_Workstation_Container;
		this.character = character;
		this.lvlClass = charClass;
		this.isNewChar = isNewChar;
		skillMap = character.getSkillsMap();
		initComponents();
		initSkillTextList();
		skillPoints = character.getSkillPointsLefts();		
		jTFSkillPointsLeft.setText("" + skillPoints);
	}

	private void initSkillTextList() {
		String text = "";
		for (String skill : Skills) {
			Skill sk = skillMap.get(skill);
			String spaces = calculateSpaces(sk.getName());
			text = text + sk.getName() + spaces + sk.getBase() + "\n";
		}
		jTACharSkills.setText(text);

	}

	private String calculateSpaces(String name) {
		int size = name.length();
		if (size >= 16) {
			return ("\t\t");
		}
		return ("\t\t\t");
	}

	private void initComponents() {

		jPanel1 = new javax.swing.JPanel();
		jLabel1 = new javax.swing.JLabel();
		jSeparator1 = new javax.swing.JSeparator();
		jSeparator2 = new javax.swing.JSeparator();
		jScrollPane1 = new javax.swing.JScrollPane();
		jLSkills = new javax.swing.JList();
		jBNext = new javax.swing.JButton();
		jBBack = new javax.swing.JButton();
		jBSelectSkillEdit = new javax.swing.JButton();
		jScrollPane2 = new javax.swing.JScrollPane();
		jTACharSkills = new javax.swing.JTextArea();
		jLabel2 = new javax.swing.JLabel();
		jTFSkillName = new javax.swing.JTextField();
		jLabel3 = new javax.swing.JLabel();
		jTFSKillValue = new javax.swing.JTextField();
		jLabel4 = new javax.swing.JLabel();
		jTFSkillPointsLeft = new javax.swing.JTextField();
		jLabel5 = new javax.swing.JLabel();
		jBSub = new javax.swing.JButton();
		jBAdd = new javax.swing.JButton();
		jBSave = new javax.swing.JButton();

		jPanel1.setBackground(new java.awt.Color(0, 0, 102));
		jPanel1.setMinimumSize(new java.awt.Dimension(800, 600));

		jLabel1.setFont(new java.awt.Font("Tahoma", 0, 28));
		jLabel1.setForeground(new java.awt.Color(255, 255, 255));
		jLabel1.setText("Character Skills");

		jLSkills.setFont(new java.awt.Font("Tahoma", 0, 12));
		jLSkills.setModel(new javax.swing.AbstractListModel() {
			String[] strings = { "Appraise (Int)", "Balance (Dex)",
					"Bluff (Cha)", "Climb (Str)", "Concentration (Con)",
					"Craft (Int)", "Diplomacy (Cha) ", "Disable Device (Int)",
					"Disguise (Cha)", "Escape Artist (Dex)",
					"Gather Information (Cha)", "Handle Animal (Cha)",
					"Heal (Wis)", "Hide (Dex)", "Intimidate (Cha)",
					"Jump (Str)", "Knowledge (Int)", "Listen (Wis)",
					"Move Silently (Dex)", "Open Lock (Dex)", "Perform (Cha)",
					"Ride (Dex)", "Search (Int)", "Sense Motive (Wis)",
					"Sleight of Hand (Dex)", "Spellcraft (Int)", "Spot (Wis)",
					"Survival (Wis)", "Swim (Str)", "Tumble (Dex)",
					"Use Magic Device (Cha)" };

			public int getSize() {
				return strings.length;
			}

			public Object getElementAt(int i) {
				return strings[i];
			}
		});
		jScrollPane1.setViewportView(jLSkills);

		jBNext.setText("Next");
		jBNext.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jBNextActionPerformed(evt);
			}
		});

		jBBack.setText("Back");
		jBBack.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jBBackActionPerformed(evt);
			}
		});

		jBSelectSkillEdit.setText("Select Skill to Edit");
		jBSelectSkillEdit
				.addActionListener(new java.awt.event.ActionListener() {
					public void actionPerformed(java.awt.event.ActionEvent evt) {
						jBSelectSkillEditActionPerformed(evt);
					}
				});

		jTACharSkills.setColumns(20);
		jTACharSkills.setEditable(false);
		jTACharSkills.setRows(5);
		jScrollPane2.setViewportView(jTACharSkills);

		jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14));
		jLabel2.setForeground(new java.awt.Color(255, 255, 255));
		jLabel2.setText("Skill Name");

		jTFSkillName.setEditable(false);

		jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14));
		jLabel3.setForeground(new java.awt.Color(255, 255, 255));
		jLabel3.setText("Skill Points Left:");

		jTFSKillValue.setEditable(false);

		jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14));
		jLabel4.setForeground(new java.awt.Color(255, 255, 255));
		jLabel4.setText("Skill Value");

		jTFSkillPointsLeft.setEditable(false);

		jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14));
		jLabel5.setForeground(new java.awt.Color(255, 255, 255));
		jLabel5.setText("Character Skills:");

		jBSub.setText("-");
		jBSub.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jBSubActionPerformed(evt);
			}
		});

		jBAdd.setText("+");
		jBAdd.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jBAddActionPerformed(evt);
			}
		});

		jBSave.setText("Save");
		jBSave.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jBSaveActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(
				jPanel1);
		jPanel1.setLayout(jPanel1Layout);
		jPanel1Layout
				.setHorizontalGroup(jPanel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																jSeparator2,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																780,
																Short.MAX_VALUE)
														.addGroup(
																jPanel1Layout
																		.createSequentialGroup()
																		.addComponent(
																				jLabel1)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				jSeparator1,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				586,
																				Short.MAX_VALUE))
														.addGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																jPanel1Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING)
																						.addGroup(
																								jPanel1Layout
																										.createSequentialGroup()
																										.addGroup(
																												jPanel1Layout
																														.createParallelGroup(
																																javax.swing.GroupLayout.Alignment.TRAILING)
																														.addGroup(
																																jPanel1Layout
																																		.createSequentialGroup()
																																		.addComponent(
																																				jLabel5)
																																		.addPreferredGap(
																																				javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																																				120,
																																				Short.MAX_VALUE)
																																		.addComponent(
																																				jBSelectSkillEdit))
																														.addComponent(
																																jScrollPane1,
																																javax.swing.GroupLayout.Alignment.LEADING,
																																javax.swing.GroupLayout.DEFAULT_SIZE,
																																331,
																																Short.MAX_VALUE))
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																										.addGroup(
																												jPanel1Layout
																														.createParallelGroup(
																																javax.swing.GroupLayout.Alignment.LEADING)
																														.addComponent(
																																jTFSkillName,
																																javax.swing.GroupLayout.PREFERRED_SIZE,
																																135,
																																javax.swing.GroupLayout.PREFERRED_SIZE)
																														.addComponent(
																																jLabel3)
																														.addComponent(
																																jLabel2)))
																						.addGroup(
																								jPanel1Layout
																										.createSequentialGroup()
																										.addComponent(
																												jScrollPane2,
																												javax.swing.GroupLayout.DEFAULT_SIZE,
																												476,
																												Short.MAX_VALUE)
																										.addPreferredGap(
																												javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.LEADING)
																						.addGroup(
																								jPanel1Layout
																										.createSequentialGroup()
																										.addGroup(
																												jPanel1Layout
																														.createParallelGroup(
																																javax.swing.GroupLayout.Alignment.TRAILING)
																														.addGroup(
																																jPanel1Layout
																																		.createSequentialGroup()
																																		.addGap(21,
																																				21,
																																				21)
																																		.addGroup(
																																				jPanel1Layout
																																						.createParallelGroup(
																																								javax.swing.GroupLayout.Alignment.LEADING,
																																								false)
																																						.addComponent(
																																								jLabel4)
																																						.addGroup(
																																								jPanel1Layout
																																										.createSequentialGroup()
																																										.addComponent(
																																												jBAdd)
																																										.addPreferredGap(
																																												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																																										.addComponent(
																																												jBSub)
																																										.addPreferredGap(
																																												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																																												javax.swing.GroupLayout.DEFAULT_SIZE,
																																												Short.MAX_VALUE)
																																										.addComponent(
																																												jBSave))
																																						.addComponent(
																																								jTFSKillValue,
																																								javax.swing.GroupLayout.Alignment.TRAILING,
																																								javax.swing.GroupLayout.PREFERRED_SIZE,
																																								166,
																																								javax.swing.GroupLayout.PREFERRED_SIZE))
																																		.addPreferredGap(
																																				javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																																				44,
																																				Short.MAX_VALUE))
																														.addGroup(
																																jPanel1Layout
																																		.createSequentialGroup()
																																		.addPreferredGap(
																																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																																		.addComponent(
																																				jBBack,
																																				javax.swing.GroupLayout.PREFERRED_SIZE,
																																				73,
																																				javax.swing.GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
																										.addComponent(
																												jBNext,
																												javax.swing.GroupLayout.PREFERRED_SIZE,
																												73,
																												javax.swing.GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								jPanel1Layout
																										.createSequentialGroup()
																										.addGap(3,
																												3,
																												3)
																										.addComponent(
																												jTFSkillPointsLeft,
																												javax.swing.GroupLayout.DEFAULT_SIZE,
																												301,
																												Short.MAX_VALUE)))))
										.addContainerGap()));
		jPanel1Layout
				.setVerticalGroup(jPanel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.TRAILING)
														.addComponent(
																jSeparator1,
																javax.swing.GroupLayout.PREFERRED_SIZE,
																10,
																javax.swing.GroupLayout.PREFERRED_SIZE)
														.addComponent(jLabel1))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jSeparator2,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												10,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																jPanel1Layout
																		.createSequentialGroup()
																		.addComponent(
																				jScrollPane1,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jBSelectSkillEdit)
																						.addComponent(
																								jLabel5)))
														.addGroup(
																jPanel1Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel3)
																						.addComponent(
																								jTFSkillPointsLeft,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel2)
																						.addComponent(
																								jLabel4))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jTFSkillName,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								jTFSKillValue,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addGap(18,
																				18,
																				18)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jBAdd)
																						.addComponent(
																								jBSave)
																						.addComponent(
																								jBSub))))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																jPanel1Layout
																		.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.BASELINE)
																		.addComponent(
																				jBNext)
																		.addComponent(
																				jBBack))
														.addComponent(
																jScrollPane2,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																344,
																Short.MAX_VALUE))
										.addContainerGap()));

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(jPanel1,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE).addContainerGap()));
		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				javax.swing.GroupLayout.Alignment.TRAILING,
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(jPanel1,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE).addContainerGap()));
	}// </editor-fold>//GEN-END:initComponents

	private void jBNextActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jBNextActionPerformed
		character.setSkillPointsLefts(skillPoints);
		if((character.getLevel() == 1 || character.getLevel()%3 == 0))
		{
			container.add(new CharacterBuilder5(container, character,
					lvlClass, isNewChar), "CharacterBuilder5");
			container.panels.show(container, "CharacterBuilder5");
		}
		else if (lvlClass.isCaster())
		{
			container.add(new CharacterBuilder6(container, character,
					lvlClass, isNewChar), "CharacterBuilder6");
			container.panels.show(container, "CharacterBuilder6");
		}
		else
		{
			container.add(new CharacterBuilder7(container, character, lvlClass, isNewChar), "CharacterBuilder7");
	        container.panels.show(container, "CharacterBuilder7");
		}
		
		
	}// GEN-LAST:event_jBNextActionPerformed

	private void jBBackActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jBBackActionPerformed
		if(isNewChar)
		{
			character.getRace().setinitialSkillsValues(character);
			character.setSkillPointsLefts(skillPoints);
		}
		else
		{
			character.setSkillPointsLefts(skillPoints);
		}
		container.add(new CharacterBuilder3(container, character,
				lvlClass, isNewChar), "CharacterBuilder3");
		container.panels.show(container, "CharacterBuilder3");
	}// GEN-LAST:event_jBBackActionPerformed

	private void jBSelectSkillEditActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jBSelectSkillEditActionPerformed
		if (jLSkills.getSelectedIndex() >= 0) {
			jTFSkillName.setText(Skills[jLSkills.getSelectedIndex()]);
			Skill sk = skillMap.get(jTFSkillName.getText());
			jTFSKillValue.setText("" + sk.getBase());
		}

	}// GEN-LAST:event_jBSelectSkillEditActionPerformed

	private void jBSubActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jBSubActionPerformed
		if (tempValue > 0) {
			if (lvlClass.getTrainedSkills().contains(jTFSkillName.getText())) {
				tempValue = tempValue - 1;
				jTFSKillValue.setText(""+ (Integer.parseInt(jTFSKillValue.getText()) -1));
				skillPoints = skillPoints + 1;
				jTFSkillPointsLeft.setText("" + skillPoints);
			} else {
				tempValue = tempValue - 1;
				jTFSKillValue.setText(""+ (Integer.parseInt(jTFSKillValue.getText()) -1));
				skillPoints = skillPoints + 2;
				jTFSkillPointsLeft.setText("" + skillPoints);
			}

		}
	}// GEN-LAST:event_jBSubActionPerformed

	private void jBAddActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jBAddActionPerformed
		int value = Integer.parseInt(jTFSKillValue.getText());
		if (lvlClass.getLvl() > 1 && skillPoints > 0) {
			if (tempValue == 0) {
				if (lvlClass.getTrainedSkills()
						.contains(jTFSkillName.getText()) && skillPoints -1 >=0 ) {
					tempValue = tempValue + 1;
					jTFSKillValue.setText(""+ (value + 1));
					skillPoints = skillPoints - 1;
					jTFSkillPointsLeft.setText("" + skillPoints);
				} else {
					if (skillPoints - 2 >= 0) {
						tempValue = tempValue + 1;
						jTFSKillValue.setText(""+ (value + 1));
						skillPoints = skillPoints - 2;
						jTFSkillPointsLeft.setText("" + skillPoints);
					}
				}

			}
		} else {
			if (tempValue < 4  ) {
				if (lvlClass.getTrainedSkills()
						.contains(jTFSkillName.getText()) && skillPoints -1 >= 0) {
					tempValue = tempValue + 1;
					jTFSKillValue.setText(""+ (value + 1));
					skillPoints = skillPoints - 1;
					jTFSkillPointsLeft.setText("" + skillPoints);
				} else {
					if (skillPoints - 2 >= 0) {
						tempValue = tempValue + 1;
						jTFSKillValue.setText(""+ (value + 1));
						skillPoints = skillPoints - 2;
						jTFSkillPointsLeft.setText("" + skillPoints);
					}
				}
			}
		}

	}// GEN-LAST:event_jBAddActionPerformed

	private void jBSaveActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jBSaveActionPerformed
		Skill sk = skillMap.get(jTFSkillName.getText());
		sk.setBase(Integer.parseInt(jTFSKillValue.getText()));
		skillMap.put(sk.getName(), sk);
		initSkillTextList();
		jTFSkillName.setText("");
		jTFSKillValue.setText("");
		tempValue = 0;
	}// GEN-LAST:event_jBSaveActionPerformed

	private javax.swing.JButton jBAdd;
	private javax.swing.JButton jBBack;
	private javax.swing.JButton jBNext;
	private javax.swing.JButton jBSave;
	private javax.swing.JButton jBSelectSkillEdit;
	private javax.swing.JButton jBSub;
	private javax.swing.JList jLSkills;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JPanel jPanel1;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JScrollPane jScrollPane2;
	private javax.swing.JSeparator jSeparator1;
	private javax.swing.JSeparator jSeparator2;
	private javax.swing.JTextArea jTACharSkills;
	private javax.swing.JTextField jTFSKillValue;
	private javax.swing.JTextField jTFSkillName;
	private javax.swing.JTextField jTFSkillPointsLeft;

	// End of variables declaration//GEN-END:variables

	private String characterSkillList() {
		ArrayList<Integer> bases = new ArrayList<Integer>();
		String text = "";
		HashMap<String, Skill> charSkills = character.getSkillsMap();
		for (String skill : Skills) {
			bases.add(new Integer(charSkills.get(skill).getBase()));
		}

		text = Skills[0] + "      " + bases.get(0).toString();

		for (int i = 1; i < bases.size(); i++) {
			text = text + "\n" + Skills[i] + "      " + bases.get(i).toString();
		}

		return text;
	}

}
